The process of emulating the functionality of a first computer platform (the “target system”) on a second computer platform (the “host system”) so that the host system can execute programs designed for the target system is known as “emulation.” Emulation has commonly been achieved by creating software that converts program instructions designed for the target platform (target code instructions) into the native-language of a host platform (host instructions), thus achieving compatibility. More recently, emulation has also been realized through the creation of “virtual machines,” in which the target platform's physical architecture—the design of the hardware itself—is replicated via a virtual model in software.
Two main types of emulation strategies currently are available in the emulation field. The first strategy is known as “interpretation”, in which each target code instruction is decoded in turn as it is addressed, causing a small sequence of host instructions then to be executed that are semantically equivalent to the target code instruction. The main component of such an emulator is typically a software interpreter that converts each instruction of any program in the target machine language into a set of instructions in the host machine language, where the host machine language is the code language of the host computer on which the emulator is being used. In some instances, interpreters have been implemented in computer hardware or firmware, thereby enabling relatively fast execution of the emulated programs.
The other main emulation strategy is known as “translation”, in which the target instructions are analyzed and decoded. This is also referred to as “recompilation” or “cross-compilation”. It is well known that the execution speed of computer programs is often dramatically reduced by interpreters. It is not uncommon for a computer program to run ten to twenty times slower when it is executed via interpretation than when the equivalent program is recompiled into target machine code and the target code version is executed. Due to the well known slowness of software emulation, a number of products have successfully improved on the speed of executing source applications by translating portions of the target program at run time into host machine code, and then executing the recompiled program portions. While the translation process may take, e.g., 50 to 100 machine or clock cycles per instruction of the target code, the greater speed of the resulting host machine code is, on average, enough to improve the overall speed of execution of most source applications.
Some runtime translation systems use a method known as Just In Time (JIT) translation to translate target software into host software on an as-needed basis. Examples emulation employing JIT translation schemes are described, e.g., in U.S. patent application Ser. Nos. 11/696,684, 11/696,691 and 11/696,699, which have been incorporated by reference above. Such a runtime JIT scheme is often used in translating target software of a dynamic nature. In software that is dynamic in nature, portions of code may change dynamically prior to execution. For example, within the target system, executable code may change dynamically through the loading of new executables, loading of overlays, runtime code generation or self-modifying code. Dynamic code changes may also occur by modifying memory through a number of pathways such as by executing system calls, via direct memory access (DMA) transfers from various devices, or simply by executing user code.
One of the problems of JIT translation is that the translation is performed on an as needed basis, at a point where the target software can no longer continue executing without further translation. If the underlying target system code is dynamic, the entire load of software translation may be placed onto the critical execution path of the software. Within a real time system this may cause an undesired execution slowdown when the translation load peaks. This can be particularly problematic when emulating a system where the target system being emulated is a main CPU with an attached digital signal processor (DSP) or DSP-like processor with a separate instruction memory.
It is within this context that embodiments of the present invention arise.